package fei.yuzhi.com.loveflowers.fragment.firstpagefragment.detail.baseinformation;

import android.util.Log;

import java.util.List;
import java.util.Map;

import fei.yuzhi.com.loveflowers.bean.firstpagedetailbean.GoodsCommendListBean;

/**
 * Created by My on 2016/10/8.
 */
public class BaseInformationPresenter implements BaseInfomationContract.IBaseInformationPresenter {
    private BaseInfomationContract.IBaseInformationView view;
    private BaseInfomationContract.IBaseInformationModel model;
    public BaseInformationPresenter(BaseInfomationContract.IBaseInformationView view){
        this.view=view;
        this.model=new BaseInfomationModel();
    }

    @Override
    public void getBean(final String data) {
        model.getBeanFormNet(data,new BaseInfomationModel.OnGetBaseInformationListener() {
            @Override
            public void getDetailInformation(String goodsImageUrl,
                                             Map<String,String> mTextViewMap,
                                             List<GoodsCommendListBean> commendListBeen) {
                if (goodsImageUrl!=null){
                    Log.i("tag","..........."+data);
                    view.getBeanSuccess(goodsImageUrl,mTextViewMap,commendListBeen);
                }else {
                    view.getBeanFail("图片下载失败");
                    Log.i("tag",">>>>>>>fail>>>"+data);
                }
            }
        });
    }

}
